import 'package:flutter/foundation.dart';
import 'mixins.dart';
import 'scope.dart';

/// Base class for all DAL view models.
/// This class provides a way to register repository change callbacks and value change listeners.
/// It also handles the disposal of these callbacks and listeners when the view model is disposed.
abstract class DalViewModel with ChangeNotifier, DalDisposable {
  /// The DAL scope for this view model
  final DalScope scope;

  /// Creates a new instance of [DalViewModel] with the given [scope].
  DalViewModel(this.scope);

  @override
  void dispose() {
    dalDispose();
    super.dispose();
  }
}
